When you apply .frame modifier to a View SwiftUI
● creates a new invisible container View (with the specified size)
● positions the original View inside it (using alignment: .center by default)
With the Frame around the Child View you can now align Text View at different positions around the Screen.
This would not be possible without the Frame View since the Root View does not accept alignment parameters.
Instead it always centers its child.
So in the case of Text View, Frame View is not used to increase the size of the Text View as stated here.
But in the case of Image View this can be so if you apply .resizable modifier to the Image. Then it will fill the Frame size.
This is so because it depends on the child View if it wants to keep its size or expand to the size of the Parent View.
So the confusing part about .frame is that is actually a container View (just like every other Modifier)
● that is applied differently then other container Views (through Modifier and not as a Container View)
● that is declared after the child View (for all other container Views first you declare them and then list their children)
Syntax
.frame(width: 0, minHeight: 0, maxHeight: .infinity, alignment: .bottom)
Parameters